// File:    Banco.cs
// Author:  Lucas Bittencourt
// Created: segunda-feira, 7 de novembro de 2011 20:48:44
// Purpose: Definition of Class Banco

using System;
using System.Text;

namespace DA_OOMModel
{
   public class Banco
   {
       private int bncIdBanco;
       private string bncNuBanco;
       private string bncNuDigitoBanco;
       private string bncNmBanco;
       private string bncNuCnpj;

       private Iesi.Collections.ISet agencia;
      
      /// <summary>
      /// Property for collection of Agencia
      /// </summary>
      /// <pdGenerated>Default opposite class collection property</pdGenerated>
      public virtual Iesi.Collections.ISet Agencia
      {
         get
         {
            return agencia;
         }
         set
         {
            this.agencia = value;         
         }
      }
   
      /// <summary>
      /// Get value of property BncIdBanco.
      /// </summary>
      public virtual int BncIdBanco
      {
         get
         {
            return bncIdBanco;
         }
         set
         {
            if (this.bncIdBanco != value)
               this.bncIdBanco = value;
         }
      }
      
      /// <summary>
      /// Get value of property BncNuBanco.
      /// </summary>
      public virtual string BncNuBanco
      {
         get
         {
            return bncNuBanco;
         }
         set
         {
            if (this.bncNuBanco != value)
               this.bncNuBanco = value;
         }
      }
      
      /// <summary>
      /// Get value of property BncNuDigitoBanco.
      /// </summary>
      public virtual string BncNuDigitoBanco
      {
         get
         {
            return bncNuDigitoBanco;
         }
         set
         {
            if (this.bncNuDigitoBanco != value)
               this.bncNuDigitoBanco = value;
         }
      }
      
      /// <summary>
      /// Get value of property BncNmBanco.
      /// </summary>
      public virtual string BncNmBanco
      {
         get
         {
            return bncNmBanco;
         }
         set
         {
            if (this.bncNmBanco != value)
               this.bncNmBanco = value;
         }
      }
      
      /// <summary>
      /// Get value of property BncNuCnpj.
      /// </summary>
      public virtual string BncNuCnpj
      {
         get
         {
            return bncNuCnpj;
         }
         set
         {
            if (this.bncNuCnpj != value)
               this.bncNuCnpj = value;
         }
      }
   
      /// <summary>
      /// Get and set primary key class
      /// </summary>
      public virtual BancoPK BancoPK
      {
         get 
         {
            return new BancoPK(bncIdBanco);
         }
         set
         {
            if (value != null)
            {
               this.bncIdBanco = value.BncIdBanco;
            }
         }
      }
   
      /// <summary>
      /// Get hash code
      /// </summary>
      /// <pdGenerated>Get hash code</pdGenerated>
      public override int GetHashCode()
      {
         int _hashCode = 0;
         _hashCode = 29 * BancoPK.GetHashCode();
         if (this.bncNuBanco != null) 
            _hashCode += 29 * bncNuBanco.GetHashCode();
      
         if (this.bncNuDigitoBanco != null) 
            _hashCode += 29 * bncNuDigitoBanco.GetHashCode();
      
         if (this.bncNmBanco != null) 
            _hashCode += 29 * bncNmBanco.GetHashCode();
      
         if (this.bncNuCnpj != null) 
            _hashCode += 29 * bncNuCnpj.GetHashCode();
         return _hashCode;
      }
   
      /// <summary>
      /// Test if two objects are equal
      /// </summary>
      /// <param name="object">Object to compare</param>
      /// <pdGenerated>Test if two objects are equal</pdGenerated>
      public override bool Equals(object obj)
      {
         if (obj == null)
            return false;
         Banco cast = obj as Banco;
         if (!(obj is Banco))
            return false;
         if (!this.BancoPK.Equals(cast.BancoPK))
            return false;
         if (this.bncIdBanco != cast.BncIdBanco)
            return false;
         if (String.Equals(this.bncNuBanco, cast.BncNuBanco) == false)
            return false;
      
         if (String.Equals(this.bncNuDigitoBanco, cast.BncNuDigitoBanco) == false)
            return false;
      
         if (String.Equals(this.bncNmBanco, cast.BncNmBanco) == false)
            return false;
      
         if (String.Equals(this.bncNuCnpj, cast.BncNuCnpj) == false)
            return false;
      
      
         return true;
      }
   
      /// <summary>
      /// Get object in string format
      /// </summary>
      /// <pdGenerated>Get object in string format</pdGenerated>
      public override string ToString()
      {
         StringBuilder ret = new StringBuilder();
         ret.Append( "Banco: " );
         ret.Append( "BncIdBanco='" + bncIdBanco.ToString() + "'");
         if (bncNuBanco != null)
            ret.Append( "BncNuBanco='" + bncNuBanco.ToString() + "'");
         if (bncNuDigitoBanco != null)
            ret.Append( "BncNuDigitoBanco='" + bncNuDigitoBanco.ToString() + "'");
         if (bncNmBanco != null)
            ret.Append( "BncNmBanco='" + bncNmBanco.ToString() + "'");
         if (bncNuCnpj != null)
            ret.Append( "BncNuCnpj='" + bncNuCnpj.ToString() + "'");
         return ret.ToString();
      }
   
   }
}